﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using HousingInfo.Library;

namespace NEWS.Admin
{
    public partial class LocationAdvertisement : System.Web.UI.Page
    {
        LocationAdvertisementBO boqc;
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            CheckBox checkboxqc = new CheckBox();
            int vitriqcid = Convert.ToInt32(GridView1.SelectedRow.Cells[1].Text);
            boqc = LocationAdvertisementBO.GetLocationAdvertisementBO(vitriqcid);
            txtvitriid.Text = boqc.LocationAdversitementID.ToString();
            txtvitriid.Enabled = false;
            txttenvitri.Text = boqc.LocationAdversitementName;
            checkboxqc = (CheckBox)GridView1.SelectedRow.FindControl("cbIsActive");
            cbkichhoat.Checked = checkboxqc.Checked;
            if (boqc.LocationAdvertisementDetailBOList.Count > 0)
            {
                GridView2.DataSource = boqc.LocationAdvertisementDetailBOList;
                GridView2.DataBind();
                GridView2.Visible = true;
            }
            else
                GridView2.Visible = false;
            if (pn_danhsach_qc_chitiet.Visible == false) pn_danhsach_qc_chitiet.Visible = true;
            lbmessage.Text = "";
        }

        protected void GridView2_SelectedIndexChanged(object sender, EventArgs e)
        {

        }
    }
}
